goto abort_transaction;
}
- err = xenbus_printf(xbt, dev->nodename,
- "state", "%d", XenbusStateConnected);
- if (err) {
- message = "writing frontend XenbusStateConnected";
- goto abort_transaction;
- }
-
err = xenbus_transaction_end(xbt, 0);
if (err) {
if (err == -EAGAIN)
goto destroy_ring;
}
+ xenbus_switch_state(dev, XenbusStateConnected);
+
return 0;
abort_transaction:
*/
static int __init wait_for_devices(void)
{
- int i;
-
- for (i = 0; i < 10 * HZ; i++) {
- if (all_devices_ready()) {
- return;
- }
+ unsigned long timeout = jiffies + 10*HZ;
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
+ while (time_before(jiffies, timeout)) {
+ if (all_devices_ready())
+ return 0;
+ schedule_timeout_interruptible(HZ/10);
}
- printk(KERN_WARNING
- "XENBUS: Timeout connecting to devices!\n");
+ printk(KERN_WARNING "XENBUS: Timeout connecting to devices!\n");
+ return 0;
}
late_initcall(wait_for_devices);